<?php
/**
 * Create By: PhpStorm
 * User: yihua
 * File: Sts.php
 * Date: 2017/1/14
 * Time: 23:56
 */
namespace app\api\model\page\sts;

use app\library\PageBase;
use app\library\aliyun\sts\StsWorker;

class Sts extends PageBase
{
    public function __construct()
    {
        parent::__construct();
    }

    public function excutes($param)
    {
        $objSts = new StsWorker($param['user_id']);
        $sts = $objSts->getToken();
        $data = [
            'AccessKeyId' => $sts['Credentials']['AccessKeyId'],
            'AccessKeySecret' => $sts['Credentials']['AccessKeySecret'],
            'SecurityToken' => $sts['Credentials']['SecurityToken'],
        ];
        $this->data = $data;
        return $this->getRes();
    }
}
